export const shellSort = (arr) => {
    let h = parseInt(arr.length / 2)

    while (h >= 1) {
        for (let start = 0; start < h; start++) {
            for (let i = start + h; i < arr.length; i += h) {
                const t = arr[i]
                let j
                for (j = i; j - h >= 0 && t < arr[j - h]; j -= h) {
                    arr[j] = arr[j - h]
                }
                arr[j] = t
            }
        }

        h = parseInt(h / 2)
    }

    return arr
}